<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title></title>
  </head>
  <style type="text/css">
    * {
      margin: 0;
      padding: 0;
    }
    div {
      width: 800px;
      height: 400px;
      border: 1px solid;
      margin: 100px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-around;
    }
    button {
      width: 80px;
      height: 40px;
      background-color: aquamarine;
	  color: #000;
	  text-align: center;
	  line-height: 20px;
	  border-color: #fff;
    }
    input {
      width: 200px;
      height: 40px;
      border: 2px solid skyblue;
      outline: none;
	  vertical-align: top;
    }
    p{
        margin: 0 50px;
        white-space: pre-wrap;
    }
  </style>
  <script>
    function totalDays() {
        var result = "";
      for(var i = 100;i < 1000;i++){
          var a = parseInt(i/100);
          var b = parseInt((i - a *100)/10);
          var c = parseInt((i - a * 100 - b * 10));
          if(i === a ** 3 + b ** 3 + c ** 3){
            result += "\t"+i;
          }
      }
      document.getElementById("demo").innerHTML = result;
    }
    function MultiplicationTable(){
        var result = "";
        for(var i = 1;i < 10;i++){
            for(var j = 1;j <= i;j++){
                result += j + '*' + i + '=' + i*j + '\t'; 
            }
            result += '\n';
        }
        document.getElementById("demo").innerHTML = result;
    }
    function Trapezoid(){
        var result = ""
        for(var i = 5;i > 0;i--){
            for(var j = i;j < 10;j++){
                result += "*";
            }
            result += "\n";
        }
        document.getElementById("demo").innerHTML = result;
    }
    function baseketballHeight(){
        var height = 5;
        var count = 0;
        while(height !== 0.1){
            height =Number((height * 0.3).toFixed(1));
            count++;
        }
        document.getElementById("demo").innerHTML = count + '次';
    }
    function chessboard(){
        var weight = 0;
        for(var i = 0;i < 64;i++){
            weight += 2 **i * 0.00001;
        }
        document.getElementById("demo").innerHTML = weight + "KG";
    }
    
  </script>
  <body>
    <div>
      <!-- <input id="inputCon1" type="text" value="" placeholder="输入年"/>
      <input id="inputCon2" type="text" value="" placeholder="输入月"/>
      <input id="inputCon3" type="text" value="" placeholder="输入日"/> -->
      <button type="button" onclick="totalDays()">水仙花数</button>
      <button type="button" onclick="MultiplicationTable()">九九乘法表</button>
      <button type="button" onclick="Trapezoid()">梯形打印</button>
      <button type="button" onclick="baseketballHeight()">篮球高度</button>
      <button type="button" onclick="chessboard()">棋盘芝麻计算</button>
	  <p id="demo">结果</p>
    </div>
  </body>
</html>
